{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Prima Indian Diabates Data(皮马印第安人糖尿病数据集)分类器练习"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 首先 import 必要的模块\n",
    "import pandas as pd \n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn.model_selection import GridSearchCV\n",
    "#竞赛的评价指标为logloss\n",
    "from sklearn.metrics import log_loss\n",
    "#SVM并不能直接输出各类的概率，所以在这个例子中我们用正确率作为模型预测性能的度量\n",
    "from sklearn.metrics import accuracy_score\n",
    "from matplotlib import pyplot\n",
    "import seaborn as sns\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "读取数据 & 数据探索"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Pregnancies</th>\n",
       "      <th>Glucose</th>\n",
       "      <th>BloodPressure</th>\n",
       "      <th>SkinThickness</th>\n",
       "      <th>Insulin</th>\n",
       "      <th>BMI</th>\n",
       "      <th>DiabetesPedigreeFunction</th>\n",
       "      <th>Age</th>\n",
       "      <th>Outcome</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>6</td>\n",
       "      <td>148</td>\n",
       "      <td>72</td>\n",
       "      <td>35</td>\n",
       "      <td>0</td>\n",
       "      <td>33.6</td>\n",
       "      <td>0.627</td>\n",
       "      <td>50</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>85</td>\n",
       "      <td>66</td>\n",
       "      <td>29</td>\n",
       "      <td>0</td>\n",
       "      <td>26.6</td>\n",
       "      <td>0.351</td>\n",
       "      <td>31</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>8</td>\n",
       "      <td>183</td>\n",
       "      <td>64</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>23.3</td>\n",
       "      <td>0.672</td>\n",
       "      <td>32</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>89</td>\n",
       "      <td>66</td>\n",
       "      <td>23</td>\n",
       "      <td>94</td>\n",
       "      <td>28.1</td>\n",
       "      <td>0.167</td>\n",
       "      <td>21</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>137</td>\n",
       "      <td>40</td>\n",
       "      <td>35</td>\n",
       "      <td>168</td>\n",
       "      <td>43.1</td>\n",
       "      <td>2.288</td>\n",
       "      <td>33</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Pregnancies  Glucose  BloodPressure  SkinThickness  Insulin   BMI  \\\n",
       "0            6      148             72             35        0  33.6   \n",
       "1            1       85             66             29        0  26.6   \n",
       "2            8      183             64              0        0  23.3   \n",
       "3            1       89             66             23       94  28.1   \n",
       "4            0      137             40             35      168  43.1   \n",
       "\n",
       "   DiabetesPedigreeFunction  Age  Outcome  \n",
       "0                     0.627   50        1  \n",
       "1                     0.351   31        0  \n",
       "2                     0.672   32        1  \n",
       "3                     0.167   21        0  \n",
       "4                     2.288   33        1  "
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 读取数据\n",
    "# path to where the data lies\n",
    "dpath = '~/Desktop/2nd week/'\n",
    "train = pd.read_csv(dpath +\"diabetes.csv\")\n",
    "train.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 768 entries, 0 to 767\n",
      "Data columns (total 9 columns):\n",
      "Pregnancies                 768 non-null int64\n",
      "Glucose                     768 non-null int64\n",
      "BloodPressure               768 non-null int64\n",
      "SkinThickness               768 non-null int64\n",
      "Insulin                     768 non-null int64\n",
      "BMI                         768 non-null float64\n",
      "DiabetesPedigreeFunction    768 non-null float64\n",
      "Age                         768 non-null int64\n",
      "Outcome                     768 non-null int64\n",
      "dtypes: float64(2), int64(7)\n",
      "memory usage: 54.1 KB\n"
     ]
    }
   ],
   "source": [
    "train.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pregnancies                 0\n",
       "Glucose                     0\n",
       "BloodPressure               0\n",
       "SkinThickness               0\n",
       "Insulin                     0\n",
       "BMI                         0\n",
       "DiabetesPedigreeFunction    0\n",
       "Age                         0\n",
       "Outcome                     0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "### 查看是否有空值\n",
    "train.isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Pregnancies</th>\n",
       "      <th>Glucose</th>\n",
       "      <th>BloodPressure</th>\n",
       "      <th>SkinThickness</th>\n",
       "      <th>Insulin</th>\n",
       "      <th>BMI</th>\n",
       "      <th>DiabetesPedigreeFunction</th>\n",
       "      <th>Age</th>\n",
       "      <th>Outcome</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "      <td>768.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>3.845052</td>\n",
       "      <td>120.894531</td>\n",
       "      <td>69.105469</td>\n",
       "      <td>20.536458</td>\n",
       "      <td>79.799479</td>\n",
       "      <td>31.992578</td>\n",
       "      <td>0.471876</td>\n",
       "      <td>33.240885</td>\n",
       "      <td>0.348958</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>3.369578</td>\n",
       "      <td>31.972618</td>\n",
       "      <td>19.355807</td>\n",
       "      <td>15.952218</td>\n",
       "      <td>115.244002</td>\n",
       "      <td>7.884160</td>\n",
       "      <td>0.331329</td>\n",
       "      <td>11.760232</td>\n",
       "      <td>0.476951</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.078000</td>\n",
       "      <td>21.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>99.000000</td>\n",
       "      <td>62.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>27.300000</td>\n",
       "      <td>0.243750</td>\n",
       "      <td>24.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>3.000000</td>\n",
       "      <td>117.000000</td>\n",
       "      <td>72.000000</td>\n",
       "      <td>23.000000</td>\n",
       "      <td>30.500000</td>\n",
       "      <td>32.000000</td>\n",
       "      <td>0.372500</td>\n",
       "      <td>29.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>6.000000</td>\n",
       "      <td>140.250000</td>\n",
       "      <td>80.000000</td>\n",
       "      <td>32.000000</td>\n",
       "      <td>127.250000</td>\n",
       "      <td>36.600000</td>\n",
       "      <td>0.626250</td>\n",
       "      <td>41.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>17.000000</td>\n",
       "      <td>199.000000</td>\n",
       "      <td>122.000000</td>\n",
       "      <td>99.000000</td>\n",
       "      <td>846.000000</td>\n",
       "      <td>67.100000</td>\n",
       "      <td>2.420000</td>\n",
       "      <td>81.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Pregnancies     Glucose  BloodPressure  SkinThickness     Insulin  \\\n",
       "count   768.000000  768.000000     768.000000     768.000000  768.000000   \n",
       "mean      3.845052  120.894531      69.105469      20.536458   79.799479   \n",
       "std       3.369578   31.972618      19.355807      15.952218  115.244002   \n",
       "min       0.000000    0.000000       0.000000       0.000000    0.000000   \n",
       "25%       1.000000   99.000000      62.000000       0.000000    0.000000   \n",
       "50%       3.000000  117.000000      72.000000      23.000000   30.500000   \n",
       "75%       6.000000  140.250000      80.000000      32.000000  127.250000   \n",
       "max      17.000000  199.000000     122.000000      99.000000  846.000000   \n",
       "\n",
       "              BMI  DiabetesPedigreeFunction         Age     Outcome  \n",
       "count  768.000000                768.000000  768.000000  768.000000  \n",
       "mean    31.992578                  0.471876   33.240885    0.348958  \n",
       "std      7.884160                  0.331329   11.760232    0.476951  \n",
       "min      0.000000                  0.078000   21.000000    0.000000  \n",
       "25%     27.300000                  0.243750   24.000000    0.000000  \n",
       "50%     32.000000                  0.372500   29.000000    0.000000  \n",
       "75%     36.600000                  0.626250   41.000000    1.000000  \n",
       "max     67.100000                  2.420000   81.000000    1.000000  "
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#各属性的统计特性\n",
    "train.describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "输入属性的直方图／分布"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/chin/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.\n",
      "  warnings.warn(\"The 'normed' kwarg is deprecated, and has been \"\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAENCAYAAAAMmd6uAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFUBJREFUeJzt3X+0ZWV93/H3RxAVRQfkgsggA4alVVeNrCkQTQ0NikAVaJe0gNWpks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x+VX27qv4GuJTuwwGAqjq/qn5QVT+iu3LSq5O8YGDdL1bVN/paLhpY983AQ1X1iar6v/1zDLsWwr+gmxvlyqr6SVVdDWyi+4AD+AndXzbPqe6COreNuO2koQx8LVcnVtWqqjqwqt7TBzI89UIVBwLPBLb2QyKPAv+D/38hkRfP6D94f7uHBu4/ATwPfjocdE6Su5M8Tnc5OYC951qXbqrdu0f4Nx4InLS99r7+X6Sb4OuHwD+nmwRuaz909PIRnlOalYGvlWbwsLL7gR/RXddzVf/z/KraPta+ladehm9wzvO5nEp3mbs30F1bYU3fPsplM++nu+jGKP3+YKD2VVX13Ko6B6CqvlpVb6S7PvKddPO5S/Nm4GvFqm4e/quATyR5fpJnJHlpkl/qu1wKnJFk/ySr6OZyH9UedB8mf0U3/fJv7Lj7U3wZeFGSM5M8K8keSQ4f0u8PgbckeVP/F8WzkxyZZHWSfZMc34/l/wj4a7rDVKV5M/C10r2D7svW24Hv013AfvtFLz5D94FwM92XvlfSfcE7SnBeSPel8AP9c183akHVXbT+jcBb6IZ97gL+0ZB+99P9FfEhYJpuj//f0f2/fAbwq3RXXnoE+CXgPaPWIA3jiVdqRpJj6S7aceBS1yItBffw9bSV5DlJjkuya38I5Nl01/6UmuQevp62kuxOd0jny4G/oTvm/YyqenxJC5OWiIEvSY1wSEeSGmHgS1IjDHxJaoSBL0mNMPAlqREGviQ14v8BqWbndK6xVmEAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = plt.figure()\n",
    "sns.distplot(train.Pregnancies.values, bins=30, kde=False)\n",
    "plt.xlabel('Pregnancies', fontsize=12)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/chin/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.\n",
      "  warnings.warn(\"The 'normed' kwarg is deprecated, and has been \"\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAENCAYAAAABh67pAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAE0JJREFUeJzt3X+w5XV93/HnK6yYgLHLj4UgP1xstlHjJNHZuKiZ1IG0EUWXmWqCS+3WMtmkow2JdATjpDSTpNEx468m2lBA11RQS6gQtGnoippO49YFGQVXuluEZWWFa/glahX0nT++n02O17vs3XPu5dzz4fmYuXPO98f5ft/f873ndT/3c875fFNVSJL69UPTLkCStLwMeknqnEEvSZ0z6CWpcwa9JHXOoJekzhn0ktQ5g16SOmfQS1LnVk27AIBjjz221q5dO+0yJGmm3HjjjV+rqjUHW29FBP3atWvZsWPHtMuQpJmS5M7FrGfXjSR1zqCXpM4Z9JLUOYNekjpn0EtS5wx6SeqcQS9JnTto0Ce5PMm9SW4ZmXd0kuuT7Gq3R7X5SfLuJLuTfD7J85azeEnSwS2mRf9+4CXz5l0EbKuqdcC2Ng1wJrCu/WwB3rs0ZUqSxnXQb8ZW1aeTrJ03eyPw4nZ/K/BJ4MI2/wM1XHH8M0lWJzmhqvYtVcHSrLti+55FrbdpwynLXImeKMbtoz9+f3i32+Pa/BOBu0bW29vmSZKmZKnfjM0C82rBFZMtSXYk2TE3N7fEZUiS9hs36O9JcgJAu723zd8LnDyy3knA3QttoKouqar1VbV+zZqDDr4mSRrTuKNXXgtsBt7Sbq8Zmf/6JB8CNgAP2j8vjce+fC2VgwZ9kisZ3ng9Nsle4GKGgP9IkvOAPcCr2uofB14K7Aa+Cbx2GWqWJB2CxXzq5tUHWHTGAusW8LpJi5IkLR2/GStJnTPoJalz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wceEOSM9o2v8lw2b/95v+Rm9/yvwv4/Xk1HNH+k5EWZNBrRWh95BsZhgjeOW/xFcBrk/xM64v+D8D2qroD+Djwj5JsSrIqyS8zvKF7XVXdyTD88O8kOTzJzzEE7biua/t6TZIntZ+fTfKstv1zk/yDGi788RDDH639b57+eJKMzP9u2+bNwKYkh7VP+/zjg9Twn4FfS7KhPWdHJnlZkh+d4LjUOYNe0/bnSR5mCMDfBzZX1a2jK7Q+899m6A/fB/xDhoudUFV/w9B3fgFDd84bgbOq6mvt4ZsY3ky9D7gY+MC4hdZwIfd/2vZ9N/BV4K0M3U4ArwHuSPIQ8GvAP2/z1wH/E3gY+GvgPVX1ybbsfIY/Pvu7gT56kBp2MPTT/xFwP0OX0L8c95j0xOB49JLUOVv0ktQ5g16SOmfQS1LnDHpJ6pxBL0mdM+glqXMGvSR1zqCXpM4Z9JLUub8FKJDz8rnMPN0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = plt.figure()\n",
    "sns.distplot(train.BloodPressure.values, bins=30, kde=False)\n",
    "plt.xlabel('BloodPressure', fontsize=12)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/chin/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.\n",
      "  warnings.warn(\"The 'normed' kwarg is deprecated, and has been \"\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAENCAYAAAAfTp5aAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGx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XAzf0vmKfpVqx5jm6eXxo7A11ryR8D32H4EoTfpLvaIwBJfnDW954E/opusYaDPUEXzgceF7rrVj8OUFXXVdWP9vsU3Zqf0IX++VV17KyvI6vq8YH1SktioGvNqKqngV8B/lOSi5O8vP8g8izgmDkecg/wd5KcleRIulH1gZ/1feBa4MNJTk5yWJI3JnkZcCPwk0k29gsWvI/uF8nnkpyR5C39fn8FfJtuFA5wNfDvk7wG/vpa3Cuy/q0OTQa61pSq+jW6pcTeT7fyyz7gP9MtBvG5g/b9M7qjYv4P3bWon3fEC/CLdNeh/jzdosNXAS+pqgeBfwL8R7qR/E/TXUf7u3Tz51f27V+lWx/yA/3P+yjdNcI/neQZusWdz1mmf7o0ktdDl6RGOEKXpEYY6JLUCANdkhphoEtSIwx0SWqEgS5JjTDQJakRBrokNcJAl6RG/H9IG6JJRynn7QAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = plt.figure()\n",
    "sns.distplot(train.Glucose.values, bins=30, kde=False)\n",
    "plt.xlabel('Glucose', fontsize=12)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/chin/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.\n",
      "  warnings.warn(\"The 'normed' kwarg is deprecated, and has been \"\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAENCAYAAAABh67pAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAEV1JREFUeJz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1r6pqU1W9qaoOAg6nO1v+UP/0oXTrlJ83cHY8mR8NPH4E2HsazRjmtQfThfhkjqF713F+/eYCUjvu/0n98rvPBp7ZT7/cn+R+4Fxg/BfdGXTTW7f20zMn9eWfBL4EfCbJ3Une1y9lLU3IoNcuo6pupbum5uF90SbgdODfBpbunS930U2fTOYa4G+ADdOYL7+Lbh32fQdu+1TViQBVdVtVnUp3xaH3Alck2auqHq2q86rqMLp1208CTptpx9Q+g17zJsnzkpyd7tqwJDkYOBUYn6Kgqi6jO8v9cpKdBe2oXQU8I8lZSfZMsk+SowcrVNX7gEvpwn7pEPv8BvBgkrcneXKS3ZIcPv7x0iR/kmRZVf0KuL9/zfYkL0vyO0l2Ax6km8rZPvEhJINe8+sh4Gjg+iQ/pQv4m4GzBytV1Trg3cBX0l0393FX3YXZXwm8hm4q5jbgZRPU+yu6P8h+OcmSKfa5vd/fEcDtwL10F0J/Wl/leOCWJA/T/WH2lKr6OfAMuqtPPUj3ruffAb+wpUm5Hr0kNc4zeklqnEEvSY0z6CWpcQa9JDXOoJekxhn0ktQ4g16SGmfQS1LjDHpJatz/AbBvn6CM7XZeAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = plt.figure()\n",
    "sns.distplot(train.SkinThickness.values, bins=30, kde=False)\n",
    "plt.xlabel('SkinThickness', fontsize=12)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/chin/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.\n",
      "  warnings.warn(\"The 'normed' kwarg is deprecated, and has been \"\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAENCAYAAA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tm0+BjwEPAD8KXDcStx/vDJWkjq3krtuJEkjMOglqXMGvSR1zqCXpM4Z9JLUOYNeWoAk9yT5F2348iR/sdxtkg7HoFeXkjyW5J1HYl1V9YWq+vUjsS5pIQx6SeqcQa+uJfnnSb6e5JNJnk7yaJILD5n+/STPtWmXt/KPJvkvQ/XWJ6mhe5z8rXUMjVeSD7QHUzyd5I/aJfTSsjDodTQ4m8F9008G/gNwU7tXy2uAG4ALq+q1DG5YtWuJ1vlu4FcZPMjjNxncx1xaFga9jgZ/XVWfqaqXgK0MHqRxapv2U+CtSV5dVfuq6sElWufHq+qZqnqcwU2wNi7RcqV5M+h1NPjhwYGqeqENHl9VPwH+GfABYF+S/57kzUu9TuAF4PglWq40bwa9jmpV9bWq+jUGR/kPAZ9pk34C/MJQ1V880m2TlopBr6NWklOTvKf11b8IPA+81CbvAv5RkjckeR2DZxJLK5JBr6PZK4CPMHhC0FPAPwb+JUBV3QncwuAe7fcxeDC0tCJ5P3pJ6pxH9JLUOYNekjpn0EtS5wx6SeqcQS9JnTPoJalzBr0kdc6gl6TOGfSS1Ln/B+UCPMn2oDsnAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = plt.figure()\n",
    "sns.distplot(train.Insulin.values, bins=30, kde=False)\n",
    "plt.xlabel('Insulin', fontsize=12)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/chin/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.\n",
      "  warnings.warn(\"The 'normed' kwarg is deprecated, and has been \"\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAENCAYAAADuRcXXAAAABHNCS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7sOe/j9DKZ4vrTiwaQxWbX4KtIz2meS/JTB+fu/DWysqvsG128ZqKrvMjhnuDSzPJ+9JDXAaRxJaoBlL0kNsOwlqQGWvSQ1wLKXpAZY9pLUAMtekhpg2UtSAyx7SWrA/wGg91XiqDOstQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = plt.figure()\n",
    "sns.distplot(train.BMI.values, bins=30, kde=False)\n",
    "plt.xlabel('BMI', fontsize=12)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/chin/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.\n",
      "  warnings.warn(\"The 'normed' kwarg is deprecated, and has been \"\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAENCAYAAAABh67pAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFoFJREFUeJzt3Xu0ZGV95vHvI6AGb4B9VKRpmihjgi6NpAUcTYYVdIKO2s5EMyjR1kF7NGY0kzheYhSS0aXOZLyNRoeIEfAGQSOtCzNBvC1WpLVVVC4aegw2bbdyDBdRjIr+5o+9jxTH6j51qk510W9/P2ud1VV7v7XrV/tUP+etd+96d6oKSVK77jTrAiRJ02XQS1LjDHpJapxBL0mNM+glqXEGvSQ1zqCXpMYZ9JLUOINekhq3/6wLAFi1alWtXbt21mVI0l7lC1/4wneram6pdneIoF+7di1btmyZdRmStFdJ8s1R2jl0I0mNM+glqXEGvSQ1zq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OgVGVOy16/KU1/hj9twdu3wLcvb99ON0lK5dr4fXfPLDsm8Dg8Mzi57zrCh2r0Aox6PdxSR5BF/SX0B2UXfDHdEMgx1XVt5P8GvAlbn/hh8GwW0PX8/4uXWidU1XPZbjFM+ldC3y6qh47tHHV54H16ebp/gPgPIaH8uJtDq0hyRHAwUnuNhD2a4bUBd2w0SFJDhwI+2HPPfjY3T33ocCPgFVjBOEP6IbSFtxvGY+9FnjALtbtbmbDHXSv/x4DYb+GbhhIewmHbvZRSe6Z5Al016h9T1V9dVGTe9BNgXpjf5D1tCGb+b0kR/e9/z8Hzu97++8Bnpjkt5Psl+Su6U6FXOh5f4fuYugLPgr8qyTPSHJA//OIJL+a5M5JTklyr6r6Cd34+Cin/e2yhn7IYgvwZ/32Hw08cdhGBtqe3rd95K7ajvjcO4G/B/5X/zu4U5IHJFk8LDbMZcB/SHJgkgcCp47wmAXvBF6c5NfTeWD/Bw9+8ffxc1V1LfAPwGv71/HQ/nnfu4zn1owZ9PuejyS5ma6H9wq6A5LDTq18E92Bxe8ClwJ/N6TNOXQHcL9Nd6DuhfDzcFhPN4/2fP9c/43b3m9vBp7Snxnylr6n+G/pxql39Nt7Pd2BUujGg69J8j3geXRj4Ls1Qg1Pp/sEcz3dH7Gzd7O5U4BH0h1QfTVwLl2vfNznfibdgd0r6c4SOh8Y5QLXbwR+TBfMZ7GMsK2qv6E7zvI+ugPPH+a24zKvBf60Px7wC2c0AU+jO0C7A/hb4LT+uIP2Es5HLy1TknOBr1XVsE850h2OPXppCf0w0gP6YZaT6HrrzV6cW+3xYKy0tPsBH6L7bsF24PlV9aXZliSNzqEbSWqcQzeS1DiDXpIaZ9BLUuMMeklqnEEvSY0z6CWpcf8fX9LMxEbyx3sAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = plt.figure()\n",
    "sns.distplot(train.DiabetesPedigreeFunction.values, bins=30, kde=False)\n",
    "plt.xlabel('DiabetesPedigreeFunction', fontsize=12)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/chin/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_axes.py:6462: UserWarning: The 'normed' kwarg is deprecated, and has been replaced by the 'density' kwarg.\n",
      "  warnings.warn(\"The 'normed' kwarg is deprecated, and has been \"\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAENCAYAAAABh67pAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAEqZJREFUeJzt3XuMnFd9xvHvQ0yABKhz2QRjxzhUFpciCOkqCZciSrgEGiWRCjQhLRZNZVUN5S4IUDWiKlKjUm6CIrkEMBUJpAGUFFFIFEIpVWOwEyAXE+KG4JhcvAjCtQJMf/3jfd0MZuPdnZn17hx/P9Jq5j3vmZnf8c48+/rMO2dSVUiS2vWgpS5AkrS4DHpJapxBL0mNM+glqXEGvSQ1zqCXpMYZ9JLUOINekho3Z9An+VCS3UlummXfG5JUkqP77SR5b5IdSb6R5MTFKFqSNH8r5tHnI8D7gI8ONiY5DngesHOg+YXA+v7nZOAD/eV+HX300bVu3bp5FSxJ6mzbtu17VTU1V785g76qvpRk3Sy73gW8EbhioO1M4KPVratwXZKVSVZV1d37e4x169axdevWuUqRJA1I8p359Btqjj7JGcB3q+rr++xaDdw5sL2rb5MkLZH5TN38miSHAW8Fnj/b7lnaZl01LclGYCPA2rVrF1qGJGmehjmi/23geODrSe4A1gDXJ3kU3RH8cQN91wB3zXYnVbWpqqaranpqas4pJknSkBYc9FV1Y1UdU1XrqmodXbifWFX3AFcCL+/Pv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hW6dor9OBO6rqw1W1p6qup1th9cVIy5RBr4PVBuCqqvpev31J3zZF9z/dOwf6Dl5/DHBykvv2/gDn0h39S8uSUzc66PRLRb8UOCTJPX3zQ4CVwLF0qw2uAb7V7ztu4OZ3Av9eVc87QOVKI3P1Sh10kpxDNw9/AvCLgV2XAV+lC/lf0S0ruxa4CthZVc/s17C/CfgruuVm6e/nJ1U1+IXp0rLh1I0ORhuAD1fVzqq6Z+8P8D66aZhXAr8F3AP8M92XYPwcoKp+TPclJWfTfTvQPcBFdP8jkJYlj+ilOSS5CHhUVW2Ys7O0DHlEL+2jP0/+yemcBJzH/d9GJU0c34yVftMj6KZrHk33RdT/wGR8T6k0K6duJKlxTt1IUuMMeklqnEEvSY0z6CWpcQa9JDXOoJekxv0fMHwGbcSSSdYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = plt.figure()\n",
    "sns.distplot(train.Age.values, bins=30, kde=False)\n",
    "plt.xlabel('Age', fontsize=12)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEKCAYAAAAIO8L1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAECxJREFUeJzt3XusZWV5x/Hvj5t35XYgdC4OLWMrhop0Qmj4QwVrQFtBKo2GyJROOialLRXTllojsa2JVhElGtpJsQyGimiVi6WtZESMVpAZlFvRzkgpTIYwQ0G8FS3y9I/9nroZXubsgdlnb+Z8P8nOXutZ71rnOeTAj3VPVSFJ0vb2mHQDkqTpZEBIkroMCElSlwEhSeoyICRJXQaEJKnLg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       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Target 分布，看看各类样本分布是否均衡\n",
    "sns.countplot(train.Outcome);\n",
    "pyplot.xlabel('Outcome');\n",
    "pyplot.ylabel('Number');"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "各类样本不均衡。交叉验证对分类任务缺省的是采用StratifiedKFold，在每折采样时根据各类样本按比例采样"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "特征编码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [],
   "source": [
    "y_train = train['Outcome']\n",
    "train = train.drop(['Outcome'],axis = 1)\n",
    "X_train = np.array(train)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "数据预处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 数据标准化\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "# 初始化特征的标准化器\n",
    "ss_X = StandardScaler()\n",
    "# 分别对训练和测试数据的特征进行标准化处理\n",
    "X_train = ss_X.fit_transform(X_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/chin/anaconda3/lib/python3.6/site-packages/sklearn/model_selection/_split.py:2026: FutureWarning: From version 0.21, test_size will always complement train_size unless both are specified.\n",
      "  FutureWarning)\n"
     ]
    }
   ],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "X_train_part, X_test, y_train_part, y_test = train_test_split(X_train, y_train, train_size = 0.8,random_state = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(614, 8)"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_train_part.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "模型训练"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "default Logistic Regression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "lr= LogisticRegression()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "logloss of each fold is: [0.49442383 0.50834194 0.4830274  0.43615578 0.48793522]\n",
      "cv logloss is: 0.4819768328671518\n"
     ]
    }
   ],
   "source": [
    "# 交叉验证用于评估模型性能和进行参数调优（模型选择）\n",
    "#分类任务中交叉验证缺省是采用StratifiedKFold\n",
    "from sklearn.cross_validation import cross_val_score\n",
    "loss = cross_val_score(lr, X_train, y_train, cv=5, scoring='neg_log_loss')\n",
    "print ('logloss of each fold is:',-loss)\n",
    "print ('cv logloss is:', -loss.mean())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "正则化的 Logistic Regression及参数调优"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "logistic回归的需要调整超参数有：C（正则系数，一般在log域（取log后的值）均匀设置候选参数）和正则函数penalty（L2/L1） 目标函数为：J = sum(logloss(f(xi), yi)) + C* penalty\n",
    "\n",
    "在sklearn框架下，不同学习器的参数调整步骤相同： 设置候选参数集合 调用GridSearchCV 调用fit"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=5, error_score='raise',\n",
       "       estimator=LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n",
       "          intercept_scaling=1, max_iter=100, multi_class='ovr', n_jobs=1,\n",
       "          penalty='l2', random_state=None, solver='liblinear', tol=0.0001,\n",
       "          verbose=0, warm_start=False),\n",
       "       fit_params=None, iid=True, n_jobs=1,\n",
       "       param_grid={'penalty': ['l1', 'l2'], 'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]},\n",
       "       pre_dispatch='2*n_jobs', refit=True, return_train_score='warn',\n",
       "       scoring='neg_log_loss', verbose=0)"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.model_selection import GridSearchCV\n",
    "from sklearn.linear_model import LogisticRegression\n",
    "\n",
    "#需要调优的参数\n",
    "# 请尝试将L1正则和L2正则分开，并配合合适的优化求解算法（slover）\n",
    "#tuned_parameters = {'penalty':['l1','l2'],\n",
    "#                   'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]\n",
    "#                   }\n",
    "penaltys = ['l1','l2']\n",
    "Cs = [0.001, 0.01, 0.1, 1, 10, 100, 1000]\n",
    "tuned_parameters = dict(penalty = penaltys, C = Cs)\n",
    "\n",
    "lr_penalty= LogisticRegression()\n",
    "grid= GridSearchCV(lr_penalty, tuned_parameters,cv=5, scoring='neg_log_loss')\n",
    "grid.fit(X_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/chin/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split0_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/home/chin/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split1_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/home/chin/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split2_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/home/chin/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split3_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/home/chin/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split4_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/home/chin/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('mean_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/home/chin/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('std_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'mean_fit_time': array([0.0020689 , 0.00245147, 0.00126133, 0.00153923, 0.0017303 ,\n",
       "        0.00174422, 0.00176349, 0.0017807 , 0.00181894, 0.0017345 ,\n",
       "        0.00179176, 0.00174284, 0.0017468 , 0.0017242 ]),\n",
       " 'std_fit_time': array([5.83174351e-04, 8.72053809e-04, 1.02289918e-04, 5.18629190e-05,\n",
       "        1.49530811e-04, 7.77313896e-05, 4.43578007e-05, 1.04722972e-04,\n",
       "        5.09775275e-05, 4.73540353e-05, 5.18151977e-05, 5.30325674e-05,\n",
       "        5.56893134e-05, 5.62005542e-05]),\n",
       " 'mean_score_time': array([0.00258546, 0.00146999, 0.00126767, 0.00100856, 0.00104132,\n",
       "        0.00099659, 0.00104632, 0.00099483, 0.00098181, 0.00098143,\n",
       "        0.00104876, 0.0010159 , 0.00098658, 0.00097857]),\n",
       " 'std_score_time': array([1.62400153e-03, 6.15745947e-04, 5.02611179e-04, 2.60553004e-05,\n",
       "        7.79902996e-05, 4.18626636e-05, 9.94578298e-05, 2.52766875e-05,\n",
       "        1.10261827e-05, 3.03307417e-06, 1.20600159e-04, 3.72339296e-05,\n",
       "        4.10190833e-06, 8.91392196e-06]),\n",
       " 'param_C': masked_array(data=[0.001, 0.001, 0.01, 0.01, 0.1, 0.1, 1, 1, 10, 10, 100,\n",
       "                    100, 1000, 1000],\n",
       "              mask=[False, False, False, False, False, False, False, False,\n",
       "                    False, False, False, False, False, False],\n",
       "        fill_value='?',\n",
       "             dtype=object),\n",
       " 'param_penalty': masked_array(data=['l1', 'l2', 'l1', 'l2', 'l1', 'l2', 'l1', 'l2', 'l1',\n",
       "                    'l2', 'l1', 'l2', 'l1', 'l2'],\n",
       "              mask=[False, False, False, False, False, False, False, False,\n",
       "                    False, False, False, False, False, False],\n",
       "        fill_value='?',\n",
       "             dtype=object),\n",
       " 'params': [{'C': 0.001, 'penalty': 'l1'},\n",
       "  {'C': 0.001, 'penalty': 'l2'},\n",
       "  {'C': 0.01, 'penalty': 'l1'},\n",
       "  {'C': 0.01, 'penalty': 'l2'},\n",
       "  {'C': 0.1, 'penalty': 'l1'},\n",
       "  {'C': 0.1, 'penalty': 'l2'},\n",
       "  {'C': 1, 'penalty': 'l1'},\n",
       "  {'C': 1, 'penalty': 'l2'},\n",
       "  {'C': 10, 'penalty': 'l1'},\n",
       "  {'C': 10, 'penalty': 'l2'},\n",
       "  {'C': 100, 'penalty': 'l1'},\n",
       "  {'C': 100, 'penalty': 'l2'},\n",
       "  {'C': 1000, 'penalty': 'l1'},\n",
       "  {'C': 1000, 'penalty': 'l2'}],\n",
       " 'split0_test_score': array([-0.69314718, -0.63247716, -0.64643499, -0.51842729, -0.49334887,\n",
       "        -0.4893871 , -0.49423376, -0.49442383, -0.49550481, -0.49553449,\n",
       "        -0.49564557, -0.49565533, -0.49566488, -0.49566752]),\n",
       " 'split1_test_score': array([-0.69314718, -0.64153853, -0.65138433, -0.54263843, -0.51621434,\n",
       "        -0.50836483, -0.50930133, -0.50834194, -0.50874536, -0.50865995,\n",
       "        -0.50870808, -0.5086969 , -0.50870338, -0.50870065]),\n",
       " 'split2_test_score': array([-0.69314718, -0.63662203, -0.64570415, -0.52403018, -0.47822782,\n",
       "        -0.48374951, -0.48179782, -0.4830274 , -0.48313643, -0.48326216,\n",
       "        -0.48327814, -0.48329051, -0.48329016, -0.4832934 ]),\n",
       " 'split3_test_score': array([-0.69314718, -0.63189062, -0.64433664, -0.50307754, -0.45406133,\n",
       "        -0.44275292, -0.43661859, -0.43615578, -0.43568911, -0.43565059,\n",
       "        -0.43560576, -0.43560284, -0.43559674, -0.43559809]),\n",
       " 'split4_test_score': array([-0.69314718, -0.64067605, -0.64757466, -0.53287257, -0.49692207,\n",
       "        -0.48956528, -0.48810489, -0.48793522, -0.48809165, -0.48807935,\n",
       "        -0.48810258, -0.48809877, -0.48810127, -0.48810077]),\n",
       " 'mean_test_score': array([-0.69314718, -0.63664181, -0.6470899 , -0.52422544, -0.48778682,\n",
       "        -0.48280717, -0.48206245, -0.48202874, -0.48228645, -0.48229036,\n",
       "        -0.48232119, -0.48232204, -0.48232447, -0.48232527]),\n",
       " 'std_test_score': array([1.11022302e-16, 4.00318135e-03, 2.39292199e-03, 1.33688676e-02,\n",
       "        2.07313811e-02, 2.16460757e-02, 2.44373965e-02, 2.44134571e-02,\n",
       "        2.47959684e-02, 2.47956827e-02, 2.48358638e-02, 2.48355509e-02,\n",
       "        2.48403562e-02, 2.48395553e-02]),\n",
       " 'rank_test_score': array([14, 12, 13, 11, 10,  9,  2,  1,  3,  4,  5,  6,  7,  8],\n",
       "       dtype=int32),\n",
       " 'split0_train_score': array([-0.69314718, -0.63735556, -0.64699594, -0.5192309 , -0.47577691,\n",
       "        -0.46925194, -0.4660244 , -0.46594583, -0.46589352, -0.46589258,\n",
       "        -0.46589202, -0.46589201, -0.46589201, -0.46589201]),\n",
       " 'split1_train_score': array([-0.69314718, -0.63310132, -0.63649244, -0.51411049, -0.47224296,\n",
       "        -0.46704903, -0.4642042 , -0.46410775, -0.4640626 , -0.4640616 ,\n",
       "        -0.46406112, -0.46406111, -0.4640611 , -0.4640611 ]),\n",
       " 'split2_train_score': array([-0.69314718, -0.6356616 , -0.65056852, -0.51951737, -0.47886773,\n",
       "        -0.47222043, -0.46932993, -0.46925675, -0.46921155, -0.46921058,\n",
       "        -0.4692101 , -0.46921009, -0.46921008, -0.46921008]),\n",
       " 'split3_train_score': array([-0.69314718, -0.63804443, -0.65182756, -0.52743851, -0.48994058,\n",
       "        -0.48357524, -0.48097752, -0.48088442, -0.48084379, -0.48084284,\n",
       "        -0.48084241, -0.4808424 , -0.4808424 , -0.48084239]),\n",
       " 'split4_train_score': array([-0.69314718, -0.63358836, -0.646171  , -0.51771935, -0.47759548,\n",
       "        -0.47164861, -0.46882403, -0.46875047, -0.46870588, -0.46870513,\n",
       "        -0.46870465, -0.46870464, -0.46870464, -0.46870464]),\n",
       " 'mean_train_score': array([-0.69314718, -0.63555025, -0.64641109, -0.51960333, -0.47888473,\n",
       "        -0.47274905, -0.46987202, -0.46978904, -0.46974347, -0.46974255,\n",
       "        -0.46974206, -0.46974205, -0.46974205, -0.46974205]),\n",
       " 'std_train_score': array([0.        , 0.00196666, 0.00539262, 0.00436479, 0.00596097,\n",
       "        0.00571694, 0.00585922, 0.0058569 , 0.00585954, 0.00585954,\n",
       "        0.00585957, 0.00585957, 0.00585957, 0.00585957])}"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# view the complete results (list of named tuples)\n",
    "grid.cv_results_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.4820287373783356\n",
      "{'C': 1, 'penalty': 'l2'}\n"
     ]
    }
   ],
   "source": [
    "# examine the best model\n",
    "print(-grid.best_score_)\n",
    "print(grid.best_params_)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "如果最佳值在候选参数的边缘，最好再尝试更大的候选参数或更小的候选参数，直到找到拐点。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/chin/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split0_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/home/chin/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split1_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/home/chin/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split2_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/home/chin/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split3_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/home/chin/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('split4_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/home/chin/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('mean_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "/home/chin/anaconda3/lib/python3.6/site-packages/sklearn/utils/deprecation.py:122: FutureWarning: You are accessing a training score ('std_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZQAAAEKCAYAAAA1qaOTAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xd8FHX6wPHPs+mE0BISSogBBGkhlEgRsCAKIiKIoHe2w8Lpz4J6ehb07J6cpwJypwIKqCgRECk2ioXiWQAhNJEmPRAglfTd7++P3VBTNsluZpM879drXzs7852ZZyDZJ9/5zjwjxhiUUkqpyrJZHYBSSqmaQROKUkopj9CEopRSyiM0oSillPIITShKKaU8QhOKUkopj9CEopRSyiM0oSillPIITShKKaU8wt+KnYpIIyARiAX+AEYZY1JLaFsP2ArMN8bc55r3HdAUyHE1u9IYc6Ss/UZERJjY2NhKRq+UUrXL2rVrjxpjGpfVzpKEAjwOLDfGvCIij7s+P1ZC2xeA74uZf5MxZk15dhobG8uaNeVaRSmlaj0R2eNOO6tOeV0LzHRNzwSGFddIRLoDUcCSKopLKaVUBVmVUKKMMYcAXO+RZzcQERvwGvBoCduYLiLrReRpERHvhaqUUsodXjvlJSLLgCbFLBrn5ib+D/jCGLOvmHxxkzHmgIiEAfOAW4D3S4hjDDAGICYmxs1dK6WUKi+vJRRjzICSlonIYRFpaow5JCJNgeIG1HsD/UTk/4C6QKCIZBljHjfGHHDtI1NEPgJ6UEJCMcZMAaYAJCQkaK1+pZTyEqtOeS0EbnNN3wYsOLuBMeYmY0yMMSYWeAR43xjzuIj4i0gEgIgEAEOATVUTtlJKqZJYlVBeAa4Qke3AFa7PiEiCiEwrY90g4GsRSQLWAweAqd4MVimlVNmkNj2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LQ2qvIRkcHABMAPeM8Y85LFIVWIiHwMXIqzsu1h4BljTLV7tISI9AVWAhtx/q4DPGmM+cK6qCpGRDoDM3H+bNmAT4wxz3ttf5pQlFJKeYKe8lJKKeURmlCUUkp5hCYUpZRSHqEJRSmllEdoQlFKKeURmlCU8iARySq7VanrzxWRVq7puiLyjojsdFWKXSEiPUUk0DWtNyYrn6IJRSkfISIdAT9jzC7XrGk4iy22McZ0BP4CRLiKSC4HbrAkUKVKoAlFKS8Qp1ddNcc2isgNrvk2Efmvq8exWES+EJHrXavdBCxwtWsN9ASeMsY4AFwViT93tf3M1V4pn6FdZqW84zqgCxCP887xX0RkBdAHiAXigEicpdHfc63TB/jYNd0R513/9hK2vwm40CuRK1VB2kNRyjv6Ah+7Kr0eBr7HmQD6AnOMMQ5jTDLw7WnrNAVS3Nm4K9Hkux4ApZRP0ISilHcUV5a+tPkAOUCwa3ozEC8ipf2OBgG5FYhNKa/QhKKUd6wAbnA93KgxcDHwM85HsI5wjaVE4SymWGQrcD6AMWYnsAZ4zlX9FhFpU/QMGBEJB1KMMQVVdUBKlUUTilLeMR9IAjYA3wB/d53imofzGSibgHdwPgkw3bXO55yZYO4EmgA7RGQjMJVTz0q5DKh21W9VzabVhpWqYiJS1xiT5epl/Az0McYku55X8a3rc0mD8UXb+BR4whizrQpCVsotepWXUlVvseuhR4HAC66eC8aYHBF5Bucz5feWtLLrQVyfaTJRvkZ7KEoppTxCx1CUUkp5hCYUpZRSHqEJRSmllEdoQlFKKeURmlCUUkp5hCYUpZRSHvH/r4BzxhZ7lXIAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "pd.DataFrame(grid.cv_results_).to_csv('LogisticGridSearchCV.csv')\n",
    "# plot CV误差曲线\n",
    "test_means = grid.cv_results_[ 'mean_test_score' ]\n",
    "test_stds = grid.cv_results_[ 'std_test_score' ]\n",
    "train_means = grid.cv_results_[ 'mean_train_score' ]\n",
    "train_stds = grid.cv_results_[ 'std_train_score' ]\n",
    "# plot results\n",
    "n_Cs = len(Cs)\n",
    "number_penaltys = len(penaltys)\n",
    "test_scores = np.array(test_means).reshape(n_Cs,number_penaltys)\n",
    "train_scores = np.array(train_means).reshape(n_Cs,number_penaltys)\n",
    "test_stds = np.array(test_stds).reshape(n_Cs,number_penaltys)\n",
    "train_stds = np.array(train_stds).reshape(n_Cs,number_penaltys)\n",
    "\n",
    "x_axis = np.log10(Cs)\n",
    "for i, value in enumerate(penaltys):\n",
    "    #pyplot.plot(log(Cs), test_scores[i], label= 'penalty:'   + str(value))\n",
    "    pyplot.errorbar(x_axis, test_scores[:,i], yerr=test_stds[:,i] ,label = penaltys[i] +' Test')\n",
    "    pyplot.errorbar(x_axis, train_scores[:,i], yerr=train_stds[:,i] ,label = penaltys[i] +' Train')\n",
    "    \n",
    "pyplot.legend()\n",
    "pyplot.xlabel( 'log(C)' )                                                                                                      \n",
    "pyplot.ylabel( 'neg-logloss' )\n",
    "pyplot.savefig('LogisticGridSearchCV_C.png' )\n",
    "\n",
    "pyplot.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "用LogisticRegressionCV实现正则化的 Logistic Regression"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "L1正则"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LogisticRegressionCV(Cs=[1, 10, 100, 1000], class_weight=None, cv=5,\n",
       "           dual=False, fit_intercept=True, intercept_scaling=1.0,\n",
       "           max_iter=100, multi_class='ovr', n_jobs=1, penalty='l1',\n",
       "           random_state=None, refit=True, scoring='neg_log_loss',\n",
       "           solver='liblinear', tol=0.0001, verbose=0)"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.linear_model import LogisticRegressionCV\n",
    "\n",
    "Cs = [1, 10,100,1000]\n",
    "\n",
    "# 大量样本（6W+）、高维度（93），L1正则 --> 可选用saga优化求解器(0.19版本新功能)\n",
    "# LogisticRegressionCV比GridSearchCV快\n",
    "lrcv_L1 = LogisticRegressionCV(Cs=Cs, cv = 5, scoring='neg_log_loss', penalty='l1', solver='liblinear', multi_class='ovr')\n",
    "lrcv_L1.fit(X_train, y_train) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1: array([[-0.49423696, -0.49550413, -0.49564981, -0.49566214],\n",
       "        [-0.50929917, -0.50874243, -0.50870747, -0.50870265],\n",
       "        [-0.48180315, -0.48313396, -0.48328047, -0.48328806],\n",
       "        [-0.43661758, -0.43568967, -0.43561421, -0.4355973 ],\n",
       "        [-0.48810717, -0.48809111, -0.4881004 , -0.48810275]])}"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lrcv_L1.scores_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZ4AAAEKCAYAAAAiizNaAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3XmYVOWZ/vHvzS6ryuLCjrIEdy1xF3BJ0ETIJCYx6rgMGTNhnEzCTzM6RkWNMwmO2UYz0awmM4nbJAruG2JMRAElyCotLjSgzSJgs3f38/ujDkxZVtMFdHVVdd+f6+rLOu95zznPa9H19DnnqfcoIjAzM2sqrYodgJmZtSxOPGZm1qSceMzMrEk58ZiZWZNy4jEzsyblxGNmZk3KicfMzJqUE4+ZmTWpgiYeSWMkLZZUIemaHOsnSlogaa6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": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# scores_：dict with classes as the keys, and the values as the grid of scores obtained during cross-validating each fold,\n",
    "# Each dict value has shape (n_folds, len(Cs))\n",
    "n_Cs = len(Cs)\n",
    "n_classes = 2\n",
    "scores =  np.zeros((n_classes,n_Cs))\n",
    "\n",
    "for j in range(1,n_classes):\n",
    "        scores[j][:] = np.mean(lrcv_L1.scores_[j],axis = 0)\n",
    "    \n",
    "mse_mean = -np.mean(scores, axis = 0)\n",
    "pyplot.plot(np.log10(Cs), mse_mean.reshape(n_Cs,1)) \n",
    "#plt.plot(np.log10(reg.Cs)*np.ones(3), [0.28, 0.29, 0.30])\n",
    "pyplot.xlabel('log(C)')\n",
    "pyplot.ylabel('neg-logloss')\n",
    "pyplot.show()\n",
    "\n",
    "#print ('C is:',lr_cv.C_)  #对多类分类问题，每个类别的分类器有一个C"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.4048142 ,  1.10209093, -0.2390715 ,  0.        , -0.12014191,\n",
       "         0.68833228,  0.30157787,  0.16760535]])"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lrcv_L1.coef_"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "L2正则"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LogisticRegressionCV(Cs=[1, 10, 100, 1000], class_weight=None, cv=5,\n",
       "           dual=False, fit_intercept=True, intercept_scaling=1.0,\n",
       "           max_iter=100, multi_class='ovr', n_jobs=1, penalty='l2',\n",
       "           random_state=None, refit=True, scoring='neg_log_loss',\n",
       "           solver='liblinear', tol=0.0001, verbose=0)"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.linear_model import LogisticRegressionCV\n",
    "\n",
    "Cs = [1, 10,100,1000]\n",
    "\n",
    "# 大量样本（6W+）、高维度（93），L2正则 --> 缺省用lbfgs，为了和GridSeachCV比较，也用liblinear\n",
    "\n",
    "lr_cv_L2= LogisticRegressionCV(Cs=Cs, cv = 5, scoring='neg_log_loss', penalty='l2', solver='liblinear', multi_class='ovr')\n",
    "lr_cv_L2.fit(X_train, y_train)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1: array([[-0.49442383, -0.49553449, -0.49565533, -0.49566752],\n",
       "        [-0.50834194, -0.50865995, -0.5086969 , -0.50870065],\n",
       "        [-0.4830274 , -0.48326216, -0.48329051, -0.4832934 ],\n",
       "        [-0.43615578, -0.43565059, -0.43560284, -0.43559809],\n",
       "        [-0.48793522, -0.48807935, -0.48809877, -0.48810077]])}"
      ]
     },
     "execution_count": 94,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lr_cv_L2.scores_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZ4AAAEKCAYAAAAiizNaAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3XucFNWd9/HPl2G4iYACojKMoKIGIoi2qFGDiTeMUfbJmsRb1MSsm2VN9omJG92Y9RZzQY2bjW6CG5OY7CZe2E0eULyLGpOggCIKiI54mQEUELnJdWZ+zx9dQ9p2hmlgeqp75vt+veZl1Tmnqn7H1vp11ak+pYjAzMysvXRJOwAzM+tcnHjMzKxdOfGYmVm7cuIxM7N25cRjZmbtyonHzMz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Wbty4jEzs3blxGNmZu3KicfMzNqVE4+ZmbWr/w+2GpZ4dNB6TwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# dict with classes as the keys, and the values as the grid of scores obtained during cross-validating each fold,\n",
    "# Each dict value has shape (n_folds, len(Cs))\n",
    "n_Cs = len(Cs)\n",
    "n_classes = 2\n",
    "scores =  np.zeros((n_classes,n_Cs))\n",
    "\n",
    "for j in range(1,n_classes):\n",
    "        scores[j][:] = np.mean(lr_cv_L2.scores_[j],axis = 0)\n",
    "    \n",
    "mse_mean = -np.mean(scores, axis = 0)\n",
    "pyplot.plot(np.log10(Cs), mse_mean.reshape(n_Cs,1)) \n",
    "#plt.plot(np.log10(reg.Cs)*np.ones(3), [0.28, 0.29, 0.30])\n",
    "pyplot.xlabel('log(C)')\n",
    "pyplot.ylabel('neg-logloss')\n",
    "pyplot.show()\n",
    "\n",
    "#print ('C is:',lr_cv.C_)  #对多类分类问题，每个类别的分类器有一个C"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "default SVC"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [],
   "source": [
    "#https://xacecask2.gitbooks.io/scikit-learn-user-guide-chinese-version/content/sec1.4.html\n",
    "#1.4.1.2. 得分与概率\n",
    "from sklearn.svm import LinearSVC\n",
    "from sklearn.metrics import classification_report\n",
    "from sklearn.metrics import confusion_matrix\n",
    "\n",
    "SVC1 = LinearSVC().fit(X_train_part, y_train_part)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Classification report for classifier LinearSVC(C=1.0, class_weight=None, dual=True, fit_intercept=True,\n",
      "     intercept_scaling=1, loss='squared_hinge', max_iter=1000,\n",
      "     multi_class='ovr', penalty='l2', random_state=None, tol=0.0001,\n",
      "     verbose=0):\n",
      "             precision    recall  f1-score   support\n",
      "\n",
      "          0       0.84      0.92      0.88       107\n",
      "          1       0.76      0.62      0.68        47\n",
      "\n",
      "avg / total       0.82      0.82      0.82       154\n",
      "\n",
      "\n",
      "Confusion matrix:\n",
      "[[98  9]\n",
      " [18 29]]\n"
     ]
    }
   ],
   "source": [
    "#在校验集上测试，估计模型性能\n",
    "y_predict = SVC1.predict(X_test)\n",
    "\n",
    "print(\"Classification report for classifier %s:\\n%s\\n\"\n",
    "      % (SVC1, classification_report(y_test, y_predict)))\n",
    "print(\"Confusion matrix:\\n%s\" % confusion_matrix(y_test, y_predict))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "线性SVM正则参数调优"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "线性SVM LinearSVC的需要调整正则超参数包括C（正则系数，一般在log域（取log后的值）均匀设置候选参数）和正则函数penalty（L2/L1）\n",
    "\n",
    "采用交叉验证，网格搜索步骤与Logistic回归正则参数处理类似，在此略。\n",
    "\n",
    "这里我们用校验集（X_test、y_tset）来估计模型性能"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {},
   "outputs": [],
   "source": [
    "def fit_grid_point_Linear(C, X_train, y_train, X_test, y_test):\n",
    "    \n",
    "    # 在训练集是那个利用SVC训练\n",
    "    SVC2 =  LinearSVC( C = C)\n",
    "    SVC2 = SVC2.fit(X_train, y_train)\n",
    "    \n",
    "    # 在校验集上返回accuracy\n",
    "    accuracy = SVC2.score(X_test, y_test)\n",
    "    \n",
    "    print(\"accuracy: {}\".format(accuracy))\n",
    "    return accuracy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy: 0.8051948051948052\n",
      "accuracy: 0.8311688311688312\n",
      "accuracy: 0.8311688311688312\n",
      "accuracy: 0.8311688311688312\n",
      "accuracy: 0.8311688311688312\n",
      "accuracy: 0.7532467532467533\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "No handles with labels found to put in legend.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy: 0.5909090909090909\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3XmYVNW97vHvj2ZyZGxHRFDBqNcIsZVEPUaNCg6AiCCIBooEc3LFOGRCkxsVM92YxHgSkyNxAJRBFAfUKOIU9ThAoxAFRAmJ2k604ASKTL/zx9odK9hQRXfvXjW8n+fpx67du6reeoR+2XvtvZa5OyIiIlvTInYAEREpfCoLERHJSWUhIiI5qSxERCQnlYWIiOSkshARkZxUFiIikpPKQkREclJZiIhITi1jB2gqnTt39m7dusWOISJSVObPn/+uu1fm2q9kyqJbt25UV1fHjiEiUlTM7NV89tNpKBERyUllISIiOaksREQkp5IZsxARKXfr16+npqaGtWvXfu5nbdu2pUuXLrRq1apBr62yEBEpETU1Ney0005069YNM/vXdndn5cqV1NTU0L179wa9tk5DiYiUiLVr19KpU6d/KwoAM6NTp071HnHkS2UhIlJCNi+KXNvzpdNQJeS55+Dee2HDhthJpFRtvz1861vQoUPsJNLcVBZF7tNP4fbb4dpr4emnw7ZG/gNCZIvc4ZFH4P77oaIidhppTiqLIlVTA9ddBxMmwIoV0KMHXHMNjBwJ7drFTiel6oYb4JvfhB//GH7xi9hppD7uXu8pJ3dv1OuqLIqIOzz+OPzhD3DnnbBpE5x6KowdC8cfDy00AiUp+8Y3YN48+OUvoaoKBg+OnUiytW3blpUrV35ukLvuaqi2bds2+LVVFkVg9Wq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S7SADqyEGmYo4BpyYyf7wB/JfxyPwq4zd03ufvbwKNZz9kdqM3nxZMSWZcsziMSncpCpGHqm358a9sBPgHaJt8vAg4xs639HWwDrG1ANpEmp7IQaZjHgTOThWcqgaOBuYRlLQcnYxe7Eibeq7ME2A/A3f8OVANXJLOgYmY96tbwMLNOQK27r2+uDySyNSoLkYa5E/gbsBB4BPhBctppJmEdixcJ64Y/C3yQPOc+/r08vgnsBiwzsxeAP/PZehfHAkU3C6qULs06K9LEzGxHd1+dHB3MBY5097eT9QYeTR5vaWC77jXuAC4p4vXHpcToaiiRpndvsiBNa+DK5IgDd//EzC4jrMP92paenCyUdJeKQgqJjix7opTbAAAALElEQVRERCQnjVmIiEhOKgsREclJZSEiIjmpLEREJCeVhYiI5KSyEBGRnP4XhPluaD5CMjcAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#需要调优的参数\n",
    "C_s = np.logspace(-3, 3, 7)# logspace(a,b,N)把10的a次方到10的b次方区间分成N份  \n",
    "#penalty_s = ['l1','l2']上图给出了L1正则和L2正则下、不同正则参数C对应的模型在训练集上测试集上的正确率（score）。可以看出在训练集上C越大（正则越少）的模型性能越好；但在测试集上当C=100时性能最好（L1正则和L2正则均是）\n",
    "\n",
    "\n",
    "accuracy_s = []\n",
    "for i, oneC in enumerate(C_s):\n",
    "#    for j, penalty in enumerate(penalty_s):\n",
    "    tmp = fit_grid_point_Linear(oneC, X_train, y_train, X_test, y_test)\n",
    "    accuracy_s.append(tmp)\n",
    "\n",
    "x_axis = np.log10(C_s)\n",
    "#for j, penalty in enumerate(penalty_s):\n",
    "pyplot.plot(x_axis, np.array(accuracy_s), 'b-')\n",
    "    \n",
    "pyplot.legend()\n",
    "pyplot.xlabel( 'log(C)' )                                                                                                      \n",
    "pyplot.ylabel( 'accuracy' )\n",
    "pyplot.savefig('SVM.png' )\n",
    "pyplot.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "RBF核SVM正则参数调优\n",
    "\n",
    "RBF核是SVM最常用的核函数。\n",
    "RBF核SVM 的需要调整正则超参数包括C（正则系数，一般在log域（取log后的值）均匀设置候选参数）和核函数的宽度gamma\n",
    "C越小，决策边界越平滑； \n",
    "gamma越小，决策边界越平滑。\n",
    "\n",
    "采用交叉验证，网格搜索步骤与Logistic回归正则参数处理类似，在此略。\n",
    "\n",
    "这里我们用校验集（X_test、y_test）来估计模型性能"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.svm import SVC"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {},
   "outputs": [],
   "source": [
    "def fit_grid_point_RBF(C, gamma, X_train, y_train, X_test, y_test):\n",
    "    \n",
    "    # 在训练集是那个利用SVC训练\n",
    "    SVC3 =  SVC( C = C, kernel='rbf', gamma = gamma,random_state = 42)\n",
    "    SVC3 = SVC3.fit(X_train, y_train)\n",
    "    \n",
    "    # 在校验集上返回accuracy\n",
    "    accuracy = SVC3.score(X_test, y_test)\n",
    "    \n",
    "    print(\"accuracy: {}\".format(accuracy))\n",
    "    return accuracy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.8181818181818182\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.8376623376623377\n",
      "accuracy: 0.8506493506493507\n",
      "accuracy: 0.961038961038961\n",
      "accuracy: 1.0\n",
      "accuracy: 1.0\n",
      "accuracy: 0.8311688311688312\n",
      "accuracy: 0.9025974025974026\n",
      "accuracy: 1.0\n",
      "accuracy: 1.0\n",
      "accuracy: 1.0\n",
      "accuracy: 0.8116883116883117\n",
      "accuracy: 0.9285714285714286\n",
      "accuracy: 1.0\n",
      "accuracy: 1.0\n",
      "accuracy: 1.0\n"
     ]
    }
   ],
   "source": [
    "#需要调优的参数\n",
    "C_s = np.logspace(-2, 2, 5)# logspace(a,b,N)把10的a次方到10的b次方区间分成N份 \n",
    "gamma_s = np.logspace(-2, 2, 5)  \n",
    "\n",
    "accuracy_s = []\n",
    "for i, oneC in enumerate(C_s):\n",
    "    for j, gamma in enumerate(gamma_s):\n",
    "        tmp = fit_grid_point_RBF(oneC, gamma, X_train, y_train, X_test, y_test)\n",
    "        accuracy_s.append(tmp)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从上述部分运行结果来看，gamma参数设置不合适（gamma越大，对应RBF核的sigma越小，决策边界更复杂，可能发生了过拟合）所以调小gamma值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.7207792207792207\n",
      "accuracy: 0.8376623376623377\n",
      "accuracy: 0.6948051948051948\n",
      "accuracy: 0.7207792207792207\n",
      "accuracy: 0.8246753246753247\n",
      "accuracy: 0.8311688311688312\n",
      "accuracy: 0.7207792207792207\n",
      "accuracy: 0.8246753246753247\n",
      "accuracy: 0.8181818181818182\n",
      "accuracy: 0.8116883116883117\n"
     ]
    }
   ],
   "source": [
    "#需要调优的参数\n",
    "C_s = np.logspace(-1, 2, 4)# logspace(a,b,N)把10的a次方到10的b次方区间分成N份 \n",
    "gamma_s = np.logspace(-5, -2, 4)  \n",
    "\n",
    "accuracy_s = []\n",
    "for i, oneC in enumerate(C_s):\n",
    "    for j, gamma in enumerate(gamma_s):\n",
    "        tmp = fit_grid_point_RBF(oneC, gamma, X_train, y_train, X_test, y_test)\n",
    "        accuracy_s.append(tmp)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzsnXl4TGf7xz9PJokssifWIBS1i4gt6Eu9tqJatEX7/mhVF0v7anmL0kXRBV2UamsppaWbqq1VbSmtWNKiiD22JJZkssmemXl+f8xkhIREZHImmedzXXNlzjnPOec7Y8w997PcXyGlRKFQKBSKW+GktQCFQqFQ2D8qWCgUCoWiWFSwUCgUCkWxqGChUCgUimJRwUKhUCgUxaKChUKhUCiKRQULhUKhUBSLChYKhUKhKBYVLBQKhUJRLM5aCygrAgMDZUhIiNYyFAqFokLx119/JUopg4prV2mCRUhICFFRUVrLUCgUigqFEOJcSdqpbiiFQqFQFItNg4UQoo8Q4rgQ4pQQYnIRx+sKIbYJIfYLIf4RQtxXxPF0IcREW+pUKBQKxa2xWbAQQuiAhUBfoBkwTAjR7IZm04CvpZRtgKHARzccfw/40VYaFQqFQlEybDlm0R44JaWMARBCrAEGAtEF2kjA2/LcB4jPPyCEeACIATJKKyAvL4/Y2Fiys7NLewmFohBubm4EBwfj4uKitRSFotywZbCoDVwosB0LdLihzWvAz0KI8YAn8G8AIYQn8BLQEyh1F1RsbCxeXl6EhIQghCjtZRQKK1JK9Ho9sbGx1K9fX2s5CkW5Ycsxi6K+nW90WhoGLJdSBgP3ASuFEE7A68B7Usr0W95AiKeEE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TRZKKaX80mShlFLKL00WSiml/Pp/8QtK7FqBDKkAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "accuracy_s1 =np.array(accuracy_s).reshape(len(C_s),len(gamma_s))\n",
    "x_axis = np.log10(C_s)\n",
    "for j, gamma in enumerate(gamma_s):\n",
    "    pyplot.plot(x_axis, np.array(accuracy_s1[:,j]), label = ' Test - log(gamma)' + str(np.log10(gamma)))\n",
    "\n",
    "pyplot.legend()\n",
    "pyplot.xlabel( 'log(C)' )                                                                                                      \n",
    "pyplot.ylabel( 'accuracy' )\n",
    "pyplot.savefig('RBF_SVM.png' )\n",
    "\n",
    "pyplot.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "经比较，线性SVM比Logistics回归性能在这个例子中更好，线性SVM更适合小规模的训练数据集"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
